package pack1;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by jack on 2017/7/3.
 * Bean的初始化和销毁
 * 使用Java配置和注解配置两种方式演示
 */
public class main {

    public static void main(String[] args)
    {
        System.out.println("Start");
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(PrePostConfig.class);

        System.out.println("created new AnnotationConfigApplicationContext");

        BeanWayService beanWayService = context.getBean(BeanWayService.class);
        System.out.println("gotBean(BeanWayService.class)");

        JSR250WayService jsr250WayService = context.getBean(JSR250WayService.class);
        System.out.println("gotBean(JSR250WayService.class)");

        context.close();
    }
}
